//package com.netty;
//
//import io.netty.bootstrap.ServerBootstrap;
//import io.netty.channel.ChannelFuture;
//import io.netty.channel.ChannelInitializer;
//import io.netty.channel.ChannelOption;
//import io.netty.channel.EventLoopGroup;
//import io.netty.channel.nio.NioEventLoopGroup;
//import io.netty.channel.socket.SocketChannel;
//import io.netty.channel.socket.nio.NioServerSocketChannel;
//import io.netty.handler.logging.LogLevel;
//import io.netty.handler.logging.LoggingHandler;
//
//
///**
// * Created by Administrator on 2018/5/19/019.
// */
//public class Server {
//    public static void main(String[] args) throws InterruptedException {
//        EventLoopGroup pGroop = new NioEventLoopGroup();
//        EventLoopGroup cGroop = new NioEventLoopGroup();
//
//        ServerBootstrap b = new ServerBootstrap();
//        b.group(pGroop, cGroop).channel(NioServerSocketChannel.class)
//                .option(ChannelOption.SO_BACKLOG, 1024)
//                .option(ChannelOption.SO_SNDBUF, 32 * 1024)  //设置发送缓冲大小
//                .option(ChannelOption.SO_RCVBUF, 32 * 1024)  //这是接收缓冲大小
//                .option(ChannelOption.SO_KEEPALIVE, true)  //保持连接
//                .handler(new LoggingHandler(LogLevel.INFO))
//                .childHandler(new ChannelInitializer<SocketChannel>() {
//                    @Override
//                    protected void initChannel(SocketChannel ch) throws Exception {
//                        ch.pipeline().addLast(new ServerHander());
//                    }
//                });
//        ChannelFuture cf = b.bind(8888).sync();
//        cf.channel().closeFuture().sync();
//        System.out.println("Hello2.....");
//        pGroop.shutdownGracefully();
//        cGroop.shutdownGracefully();
//    }
//
//}
